package com.kl.drs.core;
import java.util.List;
import java.util.Map;

/**

 *  create by feihide
 */
public abstract   class BaseService<T> implements IBaseService<T> {
//	public abstract IBaseMapper<T> getBaseMapper();

	public String ping() {
        return "pong";
    }
	
	@Override
	public List<T> selectAll() {
//		return this.getBaseMapper().selectAll();
		return this.getBaseModel().selectAll();
	}

	@Override
	public List<T> selectByParameter(T record) {
//		return this.getBaseMapper().selectByParameter(record);
		return this.getBaseModel().selectByParameter(record);
	}
	
	@Override
	public T softDeleteByPrimaryKey(Integer id) {
		return this.getBaseModel().softDeleteByPrimaryKey(id);
	}
	
	public T deleteByPrimaryKey(Integer id) {
		return this.getBaseModel().deleteByPrimaryKey(id);
	}
	
	@Override
	public T insertSelective(T record) {
		return this.getBaseModel().insertSelective(record);
	}
	
	@Override
	public T selectByPrimaryKey(Integer id) {
		return this.getBaseModel().selectByPrimaryKey(id);
	}
	
	@Override
	public T updateByPrimaryKeySelective(T record) {
		return this.getBaseModel().updateBySelective(record);
	}	
	@Override
	public int insertOneRecording(T record) {
		return this.getBaseModel().insertOneRecording(record);
	}
	//查询所有信息
	@Override
	public List<T>findList(Map<String,Object> condMap){
		return this.getBaseModel().findList(condMap);
	}
	
	public abstract IBaseModel<T> getBaseModel();
}
